package com.bkgy.modular.historicalPlan.controller;

import com.alibaba.fastjson.JSONObject;
import com.bkgy.modular.historicalPlan.service.AcidRollingHistorcalPlan1720Service;
import com.bkgy.modular.historicalPlan.service.AcidRollingHistorcalPlan2130Service;
import com.bkgy.modular.historicalPlan.service.ContinuousRetirementHistoryPlan2130Service;
import com.bkgy.sys.common.entity.ResultData;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

/**
 * @author ZhuHongKai
 * @version 1.0
 * @ClassName AcidRollingHistoricalPlan2130Controller
 * @date 2022/12/16 16:32
 * 历史计划
 */
@RestController
@RequestMapping("/historicalPlan")
public class HistoricalPlanController {

    @Resource
    private AcidRollingHistorcalPlan2130Service acidRollingHistorcalPlan2130Service;

    @Resource
    private AcidRollingHistorcalPlan1720Service acidRollingHistorcalPlan1720Service;

    @Resource
    private ContinuousRetirementHistoryPlan2130Service continuousRetirementHistoryPlan2130Service;

    /**
     * 2130酸轧历史计划
     * @param jsonObject
     * @return
     */
    @PostMapping("/historcalPlan2130")
    public ResultData finByData2130(@RequestBody JSONObject jsonObject) {
        return acidRollingHistorcalPlan2130Service.findByData2130(jsonObject);
    }

    /**
     * 列表导出功能
     * @param jsonObject
     * @param response
     */
    @PostMapping("/exportXlsx2130")
    public void export(@RequestBody JSONObject jsonObject, HttpServletResponse response) {
        acidRollingHistorcalPlan2130Service.export(jsonObject,response);
    }

    /**
     * 1720酸轧历史计划
     * @param jsonObject
     * @return
     */
    @PostMapping("/historcalPlan1720")
    public ResultData findByData1720(@RequestBody JSONObject jsonObject){
        return acidRollingHistorcalPlan1720Service.findByData1720(jsonObject);
    };

    /**
     * 列表导出功能
     * @param jsonObject
     * @param response
     */
    @PostMapping("/exportXlsx1720")
    public void export1720(@RequestBody JSONObject jsonObject, HttpServletResponse response) {
        acidRollingHistorcalPlan1720Service.export(jsonObject,response);
    }

    /**
     * 2130连退历史计划
     * @param jsonObject
     * @return
     */
    @PostMapping("/ContinuousRetirementHistoryPlan2130")
    public ResultData findLianTui2130(@RequestBody JSONObject jsonObject) {
        return continuousRetirementHistoryPlan2130Service.findLianTui2130(jsonObject);
    }

    /**
     * 列表导出功能
     * @param jsonObject
     * @param response
     */
    @PostMapping("/exportXlsxliantui2130")
    public void exportXlsxliantui2130(@RequestBody JSONObject jsonObject, HttpServletResponse response) {
        continuousRetirementHistoryPlan2130Service.export(jsonObject,response);
    }
}
